package com.myframework.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.myframework.dao.UserDao;
import com.myframework.entity.User;
import com.myframework.service.UserService;

//@Transactional
@Service
public class UserServiceImpl implements UserService {

	@Autowired
	UserDao userDaoImpl;
	
	public User insertUser(User user) {
		return userDaoImpl.insertUser(user);
	}

	public User saveUser(User user) {
		userDaoImpl.save(user);
//		测试事务回滚，制造异常。
//		new Integer("zbc");
		return userDaoImpl.get(user.getId());
	}

}
